Component({
  props: {
    className: '',
    align: false,
    disabled: false,
    multipleLine: false,
    wrap: false,
    enforceExtra: false,
    titlePosition: 'top',
    
  },
  didMount: function didMount() {
    this._updateDataSet();
  },
  didUpdate: function didUpdate() {
    this._updateDataSet();
  },
  methods: {
    _updateDataSet: function _updateDataSet() {
      this.dataset = {};

      for (var key in this.props) {
        if (/data-/gi.test(key)) {
          this.dataset[key.replace(/data-/gi, '')] = this.props[key];
        }
      }
    },
    onItemTap: function onItemTap(ev) {
      var _this$props = this.props,
          onClick = _this$props.onClick,
          disabled = _this$props.disabled;

      if (onClick && !disabled) {
        onClick({
          index: ev.target.dataset.index,
          target: {
            dataset: this.dataset
          }
        });
      }
    },

    onLongItemTap: function onLongItemTap(ev) {
      var _this$props = this.props,
          onClick = _this$props.onClick,
          disabled = _this$props.disabled;
  
          console.log({'长按':JSON.stringify(ev)});
          my.confirm({
            title: '确认删除'+ev.target.dataset.code,
            content: '',
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            confirmColor: '',
            cancelColor: '',
            success: (result) => {
              if(result.confirm){
                const {data} = my.getStorageSync({key:'fundList'});
                const arr=data;
                arr.pop(ev.target.dataset.code)
                my.setStorage({
                  key: 'fundList',
                  data: arr,
                  success: (res) => {
                    console.log({ title: "setStorage success" })
                  },
                  fail: (err) => {
                    console.log({ title: "setStorage success", content: JSON.stringify(err) });
                  },
                });
              }
              console.log({'fail':JSON.stringify(result)});
            },
            fail: () => {
              
            },
            complete: () => {
              this.$page.getFundList();
            }
          });
  
      if (onClick && !disabled) {
        onClick({
          index: ev.target.dataset.index,
          target: {
            dataset: this.dataset
          }
        });
      }
    }
  }
});